package com.myworkspace.standard.common.config;

import com.myworkspace.standard.common.base.BaseDao;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;

import javax.annotation.Resource;
import javax.sql.DataSource;

@Configuration
public class BaseDaoConfiguration {
    @Resource
    private JdbcTemplate jdbcTemplate;
    @Resource
    private NamedParameterJdbcTemplate namedParameterJdbcTemplate;


    @Bean
    public BaseDao masterDao(){

        BaseDao dao = new BaseDao();
        dao.setJdbcTemplate(jdbcTemplate);
        dao.setNamedJdbcTemplate(namedParameterJdbcTemplate);
        return dao;
    }
}
